package models

import (
	"gorm.io/gorm"
)

type Review struct {
	gorm.Model
	UserID  uint `gorm:"not null"`
	User    User `gorm:"foreignKey:UserID"`
	OrderID uint `gorm:"not null"`
	DishID  uint `gorm:"not null"`
	Dish    Dish `gorm:"foreignKey:DishID"`
	Rating  int  `gorm:"not null;check:rating >= 1 AND rating <= 5"`
	Content string
	Reply   string
	Images  string `gorm:"type:json"`
}
